﻿@{
    ViewBag.Title = "GameSound";
}

<h2>Game Sound</h2>

<script type="text/javascript" src="/JsLib/game/soundjs/easeljs-NEXT.min.js"></script>
<script type="text/javascript" src="/JsLib/game/soundjs/preloadjs-NEXT.min.js"></script>
<script type="text/javascript" src="/JsLib/game/soundjs/Sound.js"></script>
<script type="text/javascript" src="/JsLib/game/soundjs/WebAudioPlugin.js"></script>
<script type="text/javascript" src="/JsLib/game/soundjs/HTMLAudioPlugin.js"></script>

<script>
    var assetsPath = "/Music/";
    manifest = [
        { id: "music", src: "val.mp3" }
    ];

    createjs.Sound.alternateExtensions = ["mp3"];
    preload = new createjs.LoadQueue(true, assetsPath);
    preload.installPlugin(createjs.Sound);
    preload.addEventListener("complete", doneLoading);
    preload.loadManifest(manifest);

    function doneLoading() {
        
        // start the music
        createjs.Sound.play("music", { interrupt: createjs.Sound.INTERRUPT_NONE, loop: -1, volume: 0.4 });

    }
</script>